package Demo;

/**
 * Created with IntelliJ IDEA.
 * Description:自定义的接口,也会生成一个独立的字节码文件
 * User: LianBao
 * Date: 2024-03-05
 * Time: 16:50
 */
public interface ITest {

    //成员变量默认是public static final
    public static final int a = 1;
    int b = 10;
    public int g = 10;

    //成员方法默认是public abstract
    public abstract void func();

    void f();

    default void funcDefault() {
        System.out.println("funcDefault");
    }

    static void funcStatic() {
        System.out.println("funcStatic");
    }

}

class testInterface implements ITest {

    @Override
    public void func() {

    }

    @Override
    public void f() {

    }

    public static void main(String[] args) {
        testInterface t = new testInterface();
        t.funcDefault();
        ITest.funcStatic();//static接口中的静态方法使用接口名调用
    }
}